<template>
  <div class="powerManage_container">
    <el-card>
      <template #header>
        <span>{{ t('deviceManage.power_manage_label') }}</span>
      </template>
      <div>
        <div class="global_btn m-r-30px" v-globalLoading="handleRestartAp">
          {{ t('deviceManage.restart_ap_label') }}
        </div>
      </div>
    </el-card>
    <el-card>
      <template #header> 
        <span>{{ t('deviceManage.factory_reset_label') }}</span>
      </template>
      <div>
        <div class="global_btn m-r-30px" v-globalLoading="handleFactoryReset"> 
          {{ t('deviceManage.restore_factory_reset_label') }}
        </div>
      </div>
    </el-card>
  </div>
</template>

<script lang="ts">
import { defineComponent } from 'vue'
export default defineComponent({
  name: 'PowerManage',
})
</script>
<script setup  lang="ts">
import { useI18n } from 'vue-i18n'
import { PowerManageApi } from '@/api/powerManage'
const { t } = useI18n()
async function handleRestartAp(){
  try {
    await PowerManageApi.reqRestartAllTerminal()
  } catch (error) {

  }
}
async function handleFactoryReset(){
  try {
    // await PowerManageApi.reqRestoreFactoryReset()
  } catch (error) {

  }
}
</script>

<style lang="scss" scoped>
@import '@/styles/pageLabel.scss';
@import '@/styles/card.scss';
.powerManage_container {
  padding: 20px;
}
.m-r-30px {
  margin-right: 30px;
}
</style>
